package sbc.group1.lab1.mozartspaces;

import org.mozartspaces.capi3.Property;
import org.mozartspaces.capi3.Query;
import org.mozartspaces.capi3.QueryCoordinator;
import org.mozartspaces.capi3.Selector;

public class SelectorFactory {
    
    public static Selector createClassSelector(Class<?> clazz) {
        return createClassSelector(clazz, 1);
    }
    
    public static Selector createClassSelector(Class<?> clazz, int count) {
        Property classProperty = Property.forClass(clazz);
        Query query = new Query();
        query.filter(classProperty.exists());
        return QueryCoordinator.newSelector(query,count);
    }

}
